updating oE malloc

malloc

include eumem.e 
namespace eumem 
export function malloc(object mem_struct_p = 1, integer cleanup_p = 1) 

allocates a block of (pseudo) memory.

Parameters:
  1. mem_struct_p : The initial structure (sequence) to occupy the allocated block. If this is an integer, a sequence of zero this long is used. The default is the number one, meaning that the default initial structure is {0}
  2. cleanup_p : Identifies whether the memory should be released automatically when the reference count for the handle for the allocated block drops to zero, or when passed to delete. If zero, then the block must be freed using the free procedure.
Returns:

A handle, to the acquired block. Once you acquire the handle you can use it as needed. Note that if cleanup_p is one, then the variable holding the handle must be capable of storing an atom (do not use an integer) as a double floating point value.

Example 1:
 my_spot = malloc() 
 ram_space[my_spot] = my_data 
Not Categorized, Please Help

Search



Quick Links

User menu

Not signed in.

Misc Menu